package com.mikao.controller;

import com.mikao.dto.bo.FeedbackForm;
import com.mikao.dto.vo.BaseResult;
import com.mikao.service.FeedbackService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Scope;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author kenny
 */


@Api(description = "反馈")
@RestController
@RequestMapping("/feedback")
@Scope("prototype")
@Validated
public class FeedbackController extends BaseController {

    private FeedbackService feedbackService;

    public FeedbackController(FeedbackService feedbackService) {
        this.feedbackService = feedbackService;
    }

    @ApiOperation("提交反馈")
    @PostMapping("/addFeedback")
    public BaseResult addFeedback(@RequestBody FeedbackForm feedbackForm) {
        return feedbackService.addFeedback(getUserId(), feedbackForm);
    }
}
